<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
	function regFun() {
		$('#regForm').form('submit', {
			url : '${pageContext.request.contextPath}/userAction!reg.action',
			success : function(data) {
				var obj = $.parseJSON(data);
				if (obj.success) {
					$('#regdialog').dialog('close');
				}
				$.messager.show({
					title : '提示',
					msg : obj.msg,
					showType : 'slide'
				});
			}
		});
	}
	$(function() {
		$('#regForm input').on('keyup', function(event) {
			if (event.keyCode == '13') {
				regFun();
			}
		});
	});
</script>
<div id="regdialog" class="easyui-dialog" data-options="title:'注册',modal:true,closed:true,
			buttons:[{
				text:'注册',
				handler:function(){
					regFun();
				}
			}]">
	<form id="regForm" method="post">
		<table>
			<tr>
				<th>用户名:</th>
				<td>
					<input name="name" type="text" class="easyui-validatebox" data-options="required:true,missingMessage:'请输入用户名'" />
				</td>
			</tr>
			<tr>
				<th>密码:</th>
				<td>
					<input name="pwd" type="password" class="easyui-validatebox" data-options="required:true,missingMessage:'请输入密码'" />
				</td>
			</tr>
			<tr>
				<th>重复密码:</th>
				<td>
					<input name="rpwd" type="password" class="easyui-validatebox" data-options="required:true,missingMessage:'请再次输入密码',validType:'equals[\'#regForm input[name=pwd]\']'" />
				</td>
			</tr>
		</table>
	</form>
</div>